@ECHO OFF   

set y=%date:~0,4%
set month=%date:~5,2%
set d=%date:~8,2%
set h=%time:~0,2%
if /i %h% LSS 10 (
  set h=0%time:~1,1%
)
set m=%time:~3,2%
set s=%time:~6,2%

SET backupdir=c:\backupdb
SET dbname=rate_jtjy
SET dbuser=root
SET dbpasswd=yhjy!admin
SET filename=rate_%y%%month%%d%%h%%m%%s%.sql
           
@ECHO Beginning backup of %filename%...

cd c:\backupdb
mysqldump -u %dbuser% -p%dbpasswd% --port 3307 --databases %dbname% > %filename%

@ECHO Done! 